import { createRouter, createWebHistory } from 'vue-router'

import ViewNotes from '../views/ViewNotes.vue'

const routes = [
  {
    path: '/',
    redirect: '/notes'
  },
  {
    path: '/notes',
    name: 'notes',
    component: ViewNotes
  },
  {
    path: '/editNote/:id',
    name: 'editNote',
    component: () => import(/* webpackChunkName: "editNote" */ '@/views/ViewEditNote.vue'),
    props: true
  },
  {
    path: '/stats',
    name: 'stats',
    component: () => import(/* webpackChunkName: "stats" */ '@/views/ViewStats.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router